# Contributor: Peter Shkenev <santurysim@gmail.com>
# Maintainer: Peter Shkenev <santurysim@gmail.com>
pkgname=care
pkgver=2.3.0
_prootver=5.4.0
pkgrel=1
pkgdesc="Comprehensive Archiver for Reproducible Execution"
url="https://proot-me.github.io/care/"
arch="aarch64 armhf armv7 x86 x86_64"
license="GPL-2.0-or-later"
depends="proot"
makedepends="
	bsd-compat-headers
	libarchive-dev
	linux-headers
	py3-docutils
	talloc-dev
	talloc-static
	uthash-dev
	"
checkdepends="bash coreutils grep lzop mcookie strace"
subpackages="$pkgname-doc"
source="https://github.com/proot-me/proot/archive/v$_prootver/proot-$_prootver.tar.gz
	10-tests-musl-compat.patch
	20-gcc14.patch
	"
options="!check"
builddir="$srcdir"/proot-"$_prootver"

build() {
	make -C src care GIT=false
	make -C doc care/man.1
}

check() {
	make -C test
}

package() {
	install -Dm 0755 "$builddir"/src/care "$pkgdir"/usr/bin/care
	install -Dm 0644 ./doc/care/man.1 "$pkgdir"/usr/share/man/man1/care.1
}

sha512sums="
c4d7b7428758c0d8f6a89ecaa01d1d7d5d9663a84b7e730e8160bc2a2385a7e278589f5dd86f5cd4f8e0736f09b3097b9efea7814096fd2d28e6032435b9ee63  proot-5.4.0.tar.gz
d09de6d776072e9991abd04e294e6d36bd1634b9e972294a112526ebf3f63e919d01755de1ecd7253d614b41b07fe6882df8787c638b8576bcf2555abcafa466  10-tests-musl-compat.patch
42cf79d69c657b1dfdc505762b374ca71cfd1856606307ec6805e4f74d5bca3e514d8b4ed09e6e8d8d551996c2f7d62e4ecd27bb5fe3b3541c8acf2a129c8463  20-gcc14.patch
"
